package com.alliky.classify.ui.adapter

import com.alliky.classify.R
import com.alliky.common.entity.vo.CategoryVo
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @Author: wxianing
 * @CreateDate: 2022/3/8 20:41
 * @Description: java类作用描述
 */
class ClassifyTitleAdapter(data: MutableList<CategoryVo>) :
    BaseQuickAdapter<CategoryVo, BaseViewHolder>(R.layout.item_cagegory_title_layout, data) {
    override fun convert(holder: BaseViewHolder, item: CategoryVo) {

        if (item.isCheck) {
            holder.setBackgroundResource(R.id.rootLayout, R.color.white)
        } else {
            holder.setBackgroundResource(R.id.rootLayout, R.color.bg_color_F7)
        }

        holder.setText(R.id.tv_name, item.title)
    }
}